<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="language" content="en" />
        <link href="./assets/ffd55088/css/bootstrap.css" rel="stylesheet">
<link href="./assets/5cf9384a/solarized_light.css" rel="stylesheet">
<link href="./assets/6c54116e/style.css" rel="stylesheet">
<script src="./assets/a44cef0f/jquery.js"></script>
<script src="./assets/ffd55088/js/bootstrap.js"></script>
<script src="./assets/8ac4e28a/jssearch.js"></script>    <title>ActiveRecord, yii\mongodb\file\ActiveRecord - Yii Framework 2.0 API Documentation</title>
</head>
<body>

<div class="wrap">
    <nav id="w11897" class="navbar-inverse navbar-fixed-top navbar" role="navigation"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#w11897-collapse"><span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span></button><a class="navbar-brand" href="./index.html">Yii Framework 2.0 API Documentation</a></div><div id="w11897-collapse" class="collapse navbar-collapse"><ul id="w11898" class="navbar-nav nav"><li><a href="./index.html">Class reference</a></li>
<li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown">Extensions <b class="caret"></b></a><ul id="w11899" class="dropdown-menu"><li><a href="./ext-apidoc-index.html" tabindex="-1">apidoc</a></li>
<li><a href="./ext-authclient-index.html" tabindex="-1">authclient</a></li>
<li><a href="./ext-bootstrap-index.html" tabindex="-1">bootstrap</a></li>
<li><a href="./ext-codeception-index.html" tabindex="-1">codeception</a></li>
<li><a href="./ext-debug-index.html" tabindex="-1">debug</a></li>
<li><a href="./ext-elasticsearch-index.html" tabindex="-1">elasticsearch</a></li>
<li><a href="./ext-faker-index.html" tabindex="-1">faker</a></li>
<li><a href="./ext-gii-index.html" tabindex="-1">gii</a></li>
<li><a href="./ext-imagine-index.html" tabindex="-1">imagine</a></li>
<li><a href="./ext-jui-index.html" tabindex="-1">jui</a></li>
<li><a href="./ext-mongodb-index.html" tabindex="-1">mongodb</a></li>
<li><a href="./ext-redis-index.html" tabindex="-1">redis</a></li>
<li><a href="./ext-smarty-index.html" tabindex="-1">smarty</a></li>
<li><a href="./ext-sphinx-index.html" tabindex="-1">sphinx</a></li>
<li><a href="./ext-swiftmailer-index.html" tabindex="-1">swiftmailer</a></li>
<li><a href="./ext-twig-index.html" tabindex="-1">twig</a></li></ul></li>
<li><a href="./guide-README.html">Guide</a></li></ul><div class="navbar-form navbar-left" role="search">
  <div class="form-group">
    <input id="searchbox" type="text" class="form-control" placeholder="Search">
  </div>
</div>
</div></nav>
    <div id="search-resultbox" style="display: none;" class="modal-content">
        <ul id="search-results">
        </ul>
    </div>

    
<div class="row">
    <div class="col-md-3">
                <div id="navigation" class="list-group"><a class="list-group-item" href="#navigation-11888" data-toggle="collapse" data-parent="#navigation">yii\mongodb <b class="caret"></b></a><div id="navigation-11888" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-activefixture.html">ActiveFixture</a>
<a class="list-group-item" href="./yii-mongodb-activequery.html">ActiveQuery</a>
<a class="list-group-item" href="./yii-mongodb-activerecord.html">ActiveRecord</a>
<a class="list-group-item" href="./yii-mongodb-batchqueryresult.html">BatchQueryResult</a>
<a class="list-group-item" href="./yii-mongodb-cache.html">Cache</a>
<a class="list-group-item" href="./yii-mongodb-collection.html">Collection</a>
<a class="list-group-item" href="./yii-mongodb-command.html">Command</a>
<a class="list-group-item" href="./yii-mongodb-connection.html">Connection</a>
<a class="list-group-item" href="./yii-mongodb-database.html">Database</a>
<a class="list-group-item" href="./yii-mongodb-exception.html">Exception</a>
<a class="list-group-item" href="./yii-mongodb-logbuilder.html">LogBuilder</a>
<a class="list-group-item" href="./yii-mongodb-migration.html">Migration</a>
<a class="list-group-item" href="./yii-mongodb-query.html">Query</a>
<a class="list-group-item" href="./yii-mongodb-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-mongodb-session.html">Session</a></div>
<a class="list-group-item" href="#navigation-11889" data-toggle="collapse" data-parent="#navigation">yii\mongodb\console\controllers <b class="caret"></b></a><div id="navigation-11889" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-console-controllers-migratecontroller.html">MigrateController</a></div>
<a class="list-group-item" href="#navigation-11890" data-toggle="collapse" data-parent="#navigation">yii\mongodb\debug <b class="caret"></b></a><div id="navigation-11890" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-debug-explainaction.html">ExplainAction</a>
<a class="list-group-item" href="./yii-mongodb-debug-mongodbpanel.html">MongoDbPanel</a></div>
<a class="list-group-item active" href="#navigation-11891" data-toggle="collapse" data-parent="#navigation">yii\mongodb\file <b class="caret"></b></a><div id="navigation-11891" class="submenu panel-collapse collapse in"><a class="list-group-item" href="./yii-mongodb-file-activequery.html">ActiveQuery</a>
<a class="list-group-item active" href="./yii-mongodb-file-activerecord.html">ActiveRecord</a>
<a class="list-group-item" href="./yii-mongodb-file-collection.html">Collection</a>
<a class="list-group-item" href="./yii-mongodb-file-cursor.html">Cursor</a>
<a class="list-group-item" href="./yii-mongodb-file-download.html">Download</a>
<a class="list-group-item" href="./yii-mongodb-file-query.html">Query</a>
<a class="list-group-item" href="./yii-mongodb-file-streamwrapper.html">StreamWrapper</a>
<a class="list-group-item" href="./yii-mongodb-file-upload.html">Upload</a></div>
<a class="list-group-item" href="#navigation-11892" data-toggle="collapse" data-parent="#navigation">yii\mongodb\gii\model <b class="caret"></b></a><div id="navigation-11892" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-gii-model-generator.html">Generator</a></div>
<a class="list-group-item" href="#navigation-11893" data-toggle="collapse" data-parent="#navigation">yii\mongodb\i18n <b class="caret"></b></a><div id="navigation-11893" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-i18n-mongodbmessagesource.html">MongoDbMessageSource</a></div>
<a class="list-group-item" href="#navigation-11894" data-toggle="collapse" data-parent="#navigation">yii\mongodb\log <b class="caret"></b></a><div id="navigation-11894" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-log-mongodbtarget.html">MongoDbTarget</a></div>
<a class="list-group-item" href="#navigation-11895" data-toggle="collapse" data-parent="#navigation">yii\mongodb\rbac <b class="caret"></b></a><div id="navigation-11895" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-rbac-mongodbmanager.html">MongoDbManager</a>
<a class="list-group-item" href="./yii-mongodb-rbac-permission.html">Permission</a>
<a class="list-group-item" href="./yii-mongodb-rbac-role.html">Role</a></div>
<a class="list-group-item" href="#navigation-11896" data-toggle="collapse" data-parent="#navigation">yii\mongodb\validators <b class="caret"></b></a><div id="navigation-11896" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-validators-mongodatevalidator.html">MongoDateValidator</a>
<a class="list-group-item" href="./yii-mongodb-validators-mongoidvalidator.html">MongoIdValidator</a></div></div>    </div>
    <div class="col-md-9 api-content" role="main">
        <h1>Abstract Class yii\mongodb\file\ActiveRecord</h1>
<div class="top-nav">
    <a href="index.html">All Classes</a>
            | <a href="#properties">Properties</a>
                | <a href="#methods">Methods</a>
                | <a href="#events">Events</a>
                | <a href="#constants">Constants</a>
    </div>

<table class="summaryTable docClass table table-bordered">
    <colgroup>
        <col class="col-name" />
        <col class="col-value" />
    </colgroup>
            <tr><th>Inheritance</th><td><a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a> &raquo;
<a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a> &raquo;
<a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a> &raquo;
<a href="yii-base-model.html">yii\base\Model</a> &raquo;
<a href="yii-base-component.html">yii\base\Component</a> &raquo;
<a href="yii-base-object.html">yii\base\Object</a></td></tr>
                <tr><th>Implements</th><td><a href="http://www.php.net/class.arrayaccess">ArrayAccess</a>, <a href="http://www.php.net/class.iteratoraggregate">IteratorAggregate</a>, <a href="yii-base-arrayable.html">yii\base\Arrayable</a>, <a href="yii-base-configurable.html">yii\base\Configurable</a>, <a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td></tr>
                    <tr><th>Uses Traits</th><td><a href="yii-base-arrayabletrait.html">yii\base\ArrayableTrait</a></td></tr>
                            <tr><th>Available since version</th><td>2.0</td></tr>
                    <tr>
          <th>Source Code</th>
          <td><a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/ActiveRecord.php">https://github.com/yiisoft/yii2-mongodb/blob/master/file/ActiveRecord.php</a></td>
        </tr>
    </table>

<div class="class-description">
    <p><strong>ActiveRecord is the base class for classes representing Mongo GridFS files in terms of objects.</strong></p>
    <p>To specify source file use the <span class="broken-link">\yii\mongodb\file\file</span> attribute. It can be specified in one of the following ways:</p>
<ul>
<li>string - full name of the file, which content should be stored in GridFS</li>
<li>\yii\web\UploadedFile - uploaded file instance, which content should be stored in GridFS</li>
</ul>
<p>For example:</p>
<pre><code class="hljs php language-php"><span class="hljs-variable">$record</span> = <span class="hljs-keyword">new</span> ImageFile();
<span class="hljs-variable">$record</span>-&gt;file = <span class="hljs-string">'/path/to/some/file.jpg'</span>;
<span class="hljs-variable">$record</span>-&gt;save();
</code></pre>
<p>You can also specify file content via <span class="broken-link">\yii\mongodb\file\newFileContent</span> attribute:</p>
<pre><code class="hljs php language-php"><span class="hljs-variable">$record</span> = <span class="hljs-keyword">new</span> ImageFile();
<span class="hljs-variable">$record</span>-&gt;newFileContent = <span class="hljs-string">'New file content'</span>;
<span class="hljs-variable">$record</span>-&gt;save();
</code></pre>
<p>Note: <span class="broken-link">\yii\mongodb\file\newFileContent</span> always takes precedence over <span class="broken-link">\yii\mongodb\file\file</span>.</p>

    </div>

<a id="properties"></a>

<div class="summary doc-property">
<h2>Public Properties</h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-property" />
    <col class="col-type" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
        <tr class="inherited" id="$activeValidators">
        <td><a href="yii-base-model.html#$activeValidators-detail">$activeValidators</a></td>
        <td><a href="yii-validators-validator.html">yii\validators\Validator</a>[]</td>
        <td>The validators applicable to the current <a href="yii-base-model.html#$scenario-detail">$scenario</a>.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="$attributes">
        <td><a href="yii-base-model.html#$attributes-detail">$attributes</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>Attribute values (name =&gt; value).</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="$behaviors">
        <td><a href="yii-base-component.html#$behaviors-detail">$behaviors</a></td>
        <td><a href="yii-base-behavior.html">yii\base\Behavior</a>[]</td>
        <td>List of behaviors attached to this component</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="$dirtyAttributes">
        <td><a href="yii-db-baseactiverecord.html#$dirtyAttributes-detail">$dirtyAttributes</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>The changed attribute values (name-value pairs)</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="$errors">
        <td><a href="yii-base-model.html#$errors-detail">$errors</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>Errors for all attributes or the specified attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="$fileContent">
        <td><a href="yii-mongodb-file-activerecord.html#$fileContent-detail">$fileContent</a></td>
        <td><a href="http://www.php.net/language.types.null">null</a>|<a href="http://www.php.net/language.types.string">string</a></td>
        <td>File content.</td>
        <td><a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a></td>
    </tr>
            <tr id="$fileResource">
        <td><a href="yii-mongodb-file-activerecord.html#$fileResource-detail">$fileResource</a></td>
        <td><a href="http://www.php.net/language.types.resource">resource</a></td>
        <td>File stream resource.</td>
        <td><a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="$firstErrors">
        <td><a href="yii-base-model.html#$firstErrors-detail">$firstErrors</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>The first errors.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="$isNewRecord">
        <td><a href="yii-db-activerecordinterface.html#$isNewRecord-detail">$isNewRecord</a></td>
        <td><a href="http://www.php.net/language.types.boolean">boolean</a></td>
        <td>Whether the record is new and should be inserted when calling <a href="yii-db-activerecordinterface.html#save()-detail">save()</a>.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="$iterator">
        <td><a href="yii-base-model.html#$iterator-detail">$iterator</a></td>
        <td><a href="http://www.php.net/class.arrayiterator">ArrayIterator</a></td>
        <td>An iterator for traversing the items in the list.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="$oldAttributes">
        <td><a href="yii-db-baseactiverecord.html#$oldAttributes-detail">$oldAttributes</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>The old attribute values (name-value pairs)</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="$oldPrimaryKey">
        <td><a href="yii-db-activerecordinterface.html#$oldPrimaryKey-detail">$oldPrimaryKey</a></td>
        <td>mixed</td>
        <td>The old primary key value.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="$primaryKey">
        <td><a href="yii-db-activerecordinterface.html#$primaryKey-detail">$primaryKey</a></td>
        <td>mixed</td>
        <td>The primary key value.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="$relatedRecords">
        <td><a href="yii-db-baseactiverecord.html#$relatedRecords-detail">$relatedRecords</a></td>
        <td><a href="http://www.php.net/language.types.array">array</a></td>
        <td>An array of related records indexed by relation names.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="$scenario">
        <td><a href="yii-base-model.html#$scenario-detail">$scenario</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a></td>
        <td>The scenario that this model is in.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="$validators">
        <td><a href="yii-base-model.html#$validators-detail">$validators</a></td>
        <td><a href="http://www.php.net/class.arrayobject">ArrayObject</a>|<a href="yii-validators-validator.html">yii\validators\Validator</a>[]</td>
        <td>All the validators declared in the model.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
    </table>
</div>

<a id="methods"></a>

<div class="summary doc-method">
<h2>Public Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-method" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
        <tr class="inherited" id="__call()">
        <td><a href="yii-base-object.html#__call()-detail">__call()</a></td>
        <td>Calls the named method which is not a class method.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__clone()">
        <td><a href="yii-base-component.html#__clone()-detail">__clone()</a></td>
        <td>This method is called after the object is created by cloning an existing one.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="__construct()">
        <td><a href="yii-base-object.html#__construct()-detail">__construct()</a></td>
        <td>Constructor.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__get()">
        <td><a href="yii-db-baseactiverecord.html#__get()-detail">__get()</a></td>
        <td>PHP getter magic method.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="__isset()">
        <td><a href="yii-db-baseactiverecord.html#__isset()-detail">__isset()</a></td>
        <td>Checks if a property value is null.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="__set()">
        <td><a href="yii-db-baseactiverecord.html#__set()-detail">__set()</a></td>
        <td>PHP setter magic method.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="__unset()">
        <td><a href="yii-db-baseactiverecord.html#__unset()-detail">__unset()</a></td>
        <td>Sets a component property to be null.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="activeAttributes()">
        <td><a href="yii-base-model.html#activeAttributes()-detail">activeAttributes()</a></td>
        <td>Returns the attribute names that are subject to validation in the current scenario.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="addError()">
        <td><a href="yii-base-model.html#addError()-detail">addError()</a></td>
        <td>Adds a new error to the specified attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="addErrors()">
        <td><a href="yii-base-model.html#addErrors()-detail">addErrors()</a></td>
        <td>Adds a list of errors.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="afterDelete()">
        <td><a href="yii-db-baseactiverecord.html#afterDelete()-detail">afterDelete()</a></td>
        <td>This method is invoked after deleting a record.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="afterFind()">
        <td><a href="yii-db-baseactiverecord.html#afterFind()-detail">afterFind()</a></td>
        <td>This method is called when the AR object is created and populated with the query result.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="afterRefresh()">
        <td><a href="yii-db-baseactiverecord.html#afterRefresh()-detail">afterRefresh()</a></td>
        <td>This method is called when the AR object is refreshed.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="afterSave()">
        <td><a href="yii-db-baseactiverecord.html#afterSave()-detail">afterSave()</a></td>
        <td>This method is called at the end of inserting or updating a record.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="afterValidate()">
        <td><a href="yii-base-model.html#afterValidate()-detail">afterValidate()</a></td>
        <td>This method is invoked after validation ends.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="attachBehavior()">
        <td><a href="yii-base-component.html#attachBehavior()-detail">attachBehavior()</a></td>
        <td>Attaches a behavior to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="attachBehaviors()">
        <td><a href="yii-base-component.html#attachBehaviors()-detail">attachBehaviors()</a></td>
        <td>Attaches a list of behaviors to the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="attributeHints()">
        <td><a href="yii-base-model.html#attributeHints()-detail">attributeHints()</a></td>
        <td>Returns the attribute hints.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="attributeLabels()">
        <td><a href="yii-base-model.html#attributeLabels()-detail">attributeLabels()</a></td>
        <td>Returns the attribute labels.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="attributes()">
        <td><a href="yii-mongodb-file-activerecord.html#attributes()-detail">attributes()</a></td>
        <td>Returns the list of all attribute names of the model.</td>
        <td><a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="beforeDelete()">
        <td><a href="yii-db-baseactiverecord.html#beforeDelete()-detail">beforeDelete()</a></td>
        <td>This method is invoked before deleting a record.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="beforeSave()">
        <td><a href="yii-db-baseactiverecord.html#beforeSave()-detail">beforeSave()</a></td>
        <td>This method is called at the beginning of inserting or updating a record.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="beforeValidate()">
        <td><a href="yii-base-model.html#beforeValidate()-detail">beforeValidate()</a></td>
        <td>This method is invoked before validation starts.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="behaviors()">
        <td><a href="yii-base-component.html#behaviors()-detail">behaviors()</a></td>
        <td>Returns a list of behaviors that this component should behave as.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="canGetProperty()">
        <td><a href="yii-base-object.html#canGetProperty()-detail">canGetProperty()</a></td>
        <td>Returns a value indicating whether a property can be read.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="canSetProperty()">
        <td><a href="yii-base-object.html#canSetProperty()-detail">canSetProperty()</a></td>
        <td>Returns a value indicating whether a property can be set.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="className()">
        <td><a href="yii-base-object.html#className()-detail">className()</a></td>
        <td>Returns the fully qualified name of this class.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="clearErrors()">
        <td><a href="yii-base-model.html#clearErrors()-detail">clearErrors()</a></td>
        <td>Removes errors for all attributes or a single attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="collectionName()">
        <td><a href="yii-mongodb-activerecord.html#collectionName()-detail">collectionName()</a></td>
        <td>Declares the name of the Mongo collection associated with this AR class.</td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="createValidators()">
        <td><a href="yii-base-model.html#createValidators()-detail">createValidators()</a></td>
        <td>Creates validator objects based on the validation rules specified in <a href="yii-base-model.html#rules()-detail">rules()</a>.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="delete()">
        <td><a href="yii-db-activerecordinterface.html#delete()-detail">delete()</a></td>
        <td>Deletes the record from the database.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="deleteAll()">
        <td><a href="yii-db-activerecordinterface.html#deleteAll()-detail">deleteAll()</a></td>
        <td>Deletes records using the provided conditions.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
                <tr class="inherited" id="detachBehavior()">
        <td><a href="yii-base-component.html#detachBehavior()-detail">detachBehavior()</a></td>
        <td>Detaches a behavior from the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="detachBehaviors()">
        <td><a href="yii-base-component.html#detachBehaviors()-detail">detachBehaviors()</a></td>
        <td>Detaches all behaviors from the component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="ensureBehaviors()">
        <td><a href="yii-base-component.html#ensureBehaviors()-detail">ensureBehaviors()</a></td>
        <td>Makes sure that the behaviors declared in <a href="yii-base-component.html#behaviors()-detail">behaviors()</a> are attached to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="equals()">
        <td><a href="yii-db-activerecordinterface.html#equals()-detail">equals()</a></td>
        <td>Returns a value indicating whether the given active record is the same as the current one.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="extraFields()">
        <td><a href="yii-base-arrayabletrait.html#extraFields()-detail">extraFields()</a></td>
        <td>Returns the list of fields that can be expanded further and returned by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a>.</td>
        <td><a href="yii-base-arrayabletrait.html">yii\base\ArrayableTrait</a></td>
    </tr>
                <tr class="inherited" id="fields()">
        <td><a href="yii-base-arrayabletrait.html#fields()-detail">fields()</a></td>
        <td>Returns the list of fields that should be returned by default by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a> when no specific fields are specified.</td>
        <td><a href="yii-base-arrayabletrait.html">yii\base\ArrayableTrait</a></td>
    </tr>
            <tr id="find()">
        <td><a href="yii-mongodb-file-activerecord.html#find()-detail">find()</a></td>
        <td>Creates an <span class="broken-link">\yii\mongodb\file\ActiveQueryInterface</span> instance for query purpose.</td>
        <td><a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="findAll()">
        <td><a href="yii-db-activerecordinterface.html#findAll()-detail">findAll()</a></td>
        <td>Returns a list of active record models that match the specified primary key value(s) or a set of column values.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
                <tr class="inherited" id="findOne()">
        <td><a href="yii-db-activerecordinterface.html#findOne()-detail">findOne()</a></td>
        <td>Returns a single active record model instance by a primary key or an array of column values.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="formName()">
        <td><a href="yii-base-model.html#formName()-detail">formName()</a></td>
        <td>Returns the form name that this model class should use.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="generateAttributeLabel()">
        <td><a href="yii-base-model.html#generateAttributeLabel()-detail">generateAttributeLabel()</a></td>
        <td>Generates a user friendly attribute label based on the give attribute name.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getActiveValidators()">
        <td><a href="yii-base-model.html#getActiveValidators()-detail">getActiveValidators()</a></td>
        <td>Returns the validators applicable to the current <a href="yii-base-model.html#$scenario-detail">$scenario</a>.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getAttribute()">
        <td><a href="yii-db-activerecordinterface.html#getAttribute()-detail">getAttribute()</a></td>
        <td>Returns the named attribute value.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="getAttributeHint()">
        <td><a href="yii-db-baseactiverecord.html#getAttributeHint()-detail">getAttributeHint()</a></td>
        <td>Returns the text hint for the specified attribute.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getAttributeLabel()">
        <td><a href="yii-db-baseactiverecord.html#getAttributeLabel()-detail">getAttributeLabel()</a></td>
        <td>Returns the text label for the specified attribute.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getAttributes()">
        <td><a href="yii-base-model.html#getAttributes()-detail">getAttributes()</a></td>
        <td>Returns attribute values.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getBehavior()">
        <td><a href="yii-base-component.html#getBehavior()-detail">getBehavior()</a></td>
        <td>Returns the named behavior object.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="getBehaviors()">
        <td><a href="yii-base-component.html#getBehaviors()-detail">getBehaviors()</a></td>
        <td>Returns all behaviors attached to this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr id="getCollection()">
        <td><a href="yii-mongodb-file-activerecord.html#getCollection()-detail">getCollection()</a></td>
        <td>Return the Mongo GridFS collection instance for this AR class.</td>
        <td><a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getDb()">
        <td><a href="yii-db-activerecordinterface.html#getDb()-detail">getDb()</a></td>
        <td>Returns the connection used by this AR class.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="getDirtyAttributes()">
        <td><a href="yii-db-baseactiverecord.html#getDirtyAttributes()-detail">getDirtyAttributes()</a></td>
        <td>Returns the attribute values that have been modified since they are loaded or saved most recently.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getErrors()">
        <td><a href="yii-base-model.html#getErrors()-detail">getErrors()</a></td>
        <td>Returns the errors for all attribute or a single attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="getFileContent()">
        <td><a href="yii-mongodb-file-activerecord.html#getFileContent()-detail">getFileContent()</a></td>
        <td>Returns the associated file content.</td>
        <td><a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a></td>
    </tr>
            <tr id="getFileResource()">
        <td><a href="yii-mongodb-file-activerecord.html#getFileResource()-detail">getFileResource()</a></td>
        <td>This method returns a stream resource that can be used with all file functions in PHP,
which deal with reading files. The contents of the file are pulled out of MongoDB on the fly,
so that the whole file does not have to be loaded into memory first.</td>
        <td><a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getFirstError()">
        <td><a href="yii-base-model.html#getFirstError()-detail">getFirstError()</a></td>
        <td>Returns the first error of the specified attribute.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getFirstErrors()">
        <td><a href="yii-base-model.html#getFirstErrors()-detail">getFirstErrors()</a></td>
        <td>Returns the first error of every attribute in the model.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getIsNewRecord()">
        <td><a href="yii-db-activerecordinterface.html#getIsNewRecord()-detail">getIsNewRecord()</a></td>
        <td>Returns a value indicating whether the current record is new (not saved in the database).</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="getIterator()">
        <td><a href="yii-base-model.html#getIterator()-detail">getIterator()</a></td>
        <td>Returns an iterator for traversing the attributes in the model.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getOldAttribute()">
        <td><a href="yii-db-baseactiverecord.html#getOldAttribute()-detail">getOldAttribute()</a></td>
        <td>Returns the old value of the named attribute.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getOldAttributes()">
        <td><a href="yii-db-baseactiverecord.html#getOldAttributes()-detail">getOldAttributes()</a></td>
        <td>Returns the old attribute values.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getOldPrimaryKey()">
        <td><a href="yii-db-activerecordinterface.html#getOldPrimaryKey()-detail">getOldPrimaryKey()</a></td>
        <td>Returns the old primary key value(s).</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="getPrimaryKey()">
        <td><a href="yii-db-activerecordinterface.html#getPrimaryKey()-detail">getPrimaryKey()</a></td>
        <td>Returns the primary key value(s).</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="getRelatedRecords()">
        <td><a href="yii-db-baseactiverecord.html#getRelatedRecords()-detail">getRelatedRecords()</a></td>
        <td>Returns all populated related records.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="getRelation()">
        <td><a href="yii-db-activerecordinterface.html#getRelation()-detail">getRelation()</a></td>
        <td>Returns the relation object with the specified name.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="getScenario()">
        <td><a href="yii-base-model.html#getScenario()-detail">getScenario()</a></td>
        <td>Returns the scenario that this model is used in.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="getValidators()">
        <td><a href="yii-base-model.html#getValidators()-detail">getValidators()</a></td>
        <td>Returns all the validators declared in <a href="yii-base-model.html#rules()-detail">rules()</a>.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="hasAttribute()">
        <td><a href="yii-db-activerecordinterface.html#hasAttribute()-detail">hasAttribute()</a></td>
        <td>Returns a value indicating whether the record has an attribute with the specified name.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="hasErrors()">
        <td><a href="yii-base-model.html#hasErrors()-detail">hasErrors()</a></td>
        <td>Returns a value indicating whether there is any validation error.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="hasEventHandlers()">
        <td><a href="yii-base-component.html#hasEventHandlers()-detail">hasEventHandlers()</a></td>
        <td>Returns a value indicating whether there is any handler attached to the named event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="hasMany()">
        <td><a href="yii-db-baseactiverecord.html#hasMany()-detail">hasMany()</a></td>
        <td>Declares a <code>has-many</code> relation.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="hasMethod()">
        <td><a href="yii-base-object.html#hasMethod()-detail">hasMethod()</a></td>
        <td>Returns a value indicating whether a method is defined.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="hasOne()">
        <td><a href="yii-db-baseactiverecord.html#hasOne()-detail">hasOne()</a></td>
        <td>Declares a <code>has-one</code> relation.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="hasProperty()">
        <td><a href="yii-base-object.html#hasProperty()-detail">hasProperty()</a></td>
        <td>Returns a value indicating whether a property is defined.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="init()">
        <td><a href="yii-db-baseactiverecord.html#init()-detail">init()</a></td>
        <td>Initializes the object.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="insert()">
        <td><a href="yii-db-activerecordinterface.html#insert()-detail">insert()</a></td>
        <td>Inserts the record into the database using the attribute values of this record.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
                <tr class="inherited" id="instantiate()">
        <td><a href="yii-db-baseactiverecord.html#instantiate()-detail">instantiate()</a></td>
        <td>Creates an active record instance.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="isAttributeActive()">
        <td><a href="yii-base-model.html#isAttributeActive()-detail">isAttributeActive()</a></td>
        <td>Returns a value indicating whether the attribute is active in the current scenario.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="isAttributeChanged()">
        <td><a href="yii-db-baseactiverecord.html#isAttributeChanged()-detail">isAttributeChanged()</a></td>
        <td>Returns a value indicating whether the named attribute has been changed.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="isAttributeRequired()">
        <td><a href="yii-base-model.html#isAttributeRequired()-detail">isAttributeRequired()</a></td>
        <td>Returns a value indicating whether the attribute is required.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="isAttributeSafe()">
        <td><a href="yii-base-model.html#isAttributeSafe()-detail">isAttributeSafe()</a></td>
        <td>Returns a value indicating whether the attribute is safe for massive assignments.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="isPrimaryKey()">
        <td><a href="yii-db-activerecordinterface.html#isPrimaryKey()-detail">isPrimaryKey()</a></td>
        <td>Returns a value indicating whether the given set of attributes represents the primary key for this model</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="isRelationPopulated()">
        <td><a href="yii-db-baseactiverecord.html#isRelationPopulated()-detail">isRelationPopulated()</a></td>
        <td>Check whether the named relation has been populated with records.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="link()">
        <td><a href="yii-db-activerecordinterface.html#link()-detail">link()</a></td>
        <td>Establishes the relationship between two records.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="load()">
        <td><a href="yii-base-model.html#load()-detail">load()</a></td>
        <td>Populates the model with input data.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="loadMultiple()">
        <td><a href="yii-base-model.html#loadMultiple()-detail">loadMultiple()</a></td>
        <td>Populates a set of models with the data from end user.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="markAttributeDirty()">
        <td><a href="yii-db-baseactiverecord.html#markAttributeDirty()-detail">markAttributeDirty()</a></td>
        <td>Marks an attribute dirty.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="off()">
        <td><a href="yii-base-component.html#off()-detail">off()</a></td>
        <td>Detaches an existing event handler from this component.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="offsetExists()">
        <td><a href="yii-db-baseactiverecord.html#offsetExists()-detail">offsetExists()</a></td>
        <td>Returns whether there is an element at the specified offset.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="offsetGet()">
        <td><a href="yii-base-model.html#offsetGet()-detail">offsetGet()</a></td>
        <td>Returns the element at the specified offset.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="offsetSet()">
        <td><a href="yii-base-model.html#offsetSet()-detail">offsetSet()</a></td>
        <td>Sets the element at the specified offset.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="offsetUnset()">
        <td><a href="yii-db-baseactiverecord.html#offsetUnset()-detail">offsetUnset()</a></td>
        <td>Sets the element value at the specified offset to null.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="on()">
        <td><a href="yii-base-component.html#on()-detail">on()</a></td>
        <td>Attaches an event handler to an event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="onUnsafeAttribute()">
        <td><a href="yii-base-model.html#onUnsafeAttribute()-detail">onUnsafeAttribute()</a></td>
        <td>This method is invoked when an unsafe attribute is being massively assigned.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="optimisticLock()">
        <td><a href="yii-db-baseactiverecord.html#optimisticLock()-detail">optimisticLock()</a></td>
        <td>Returns the name of the column that stores the lock version for implementing optimistic locking.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="populateRecord()">
        <td><a href="yii-db-baseactiverecord.html#populateRecord()-detail">populateRecord()</a></td>
        <td>Populates an active record object using a row of data from the database/storage.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="populateRelation()">
        <td><a href="yii-db-activerecordinterface.html#populateRelation()-detail">populateRelation()</a></td>
        <td>Populates the named relation with the related records.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="primaryKey()">
        <td><a href="yii-db-activerecordinterface.html#primaryKey()-detail">primaryKey()</a></td>
        <td>Returns the primary key <strong>name(s)</strong> for this AR class.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="refresh()">
        <td><a href="yii-db-baseactiverecord.html#refresh()-detail">refresh()</a></td>
        <td>Repopulates this active record with the latest data.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr id="refreshFile()">
        <td><a href="yii-mongodb-file-activerecord.html#refreshFile()-detail">refreshFile()</a></td>
        <td>Refreshes the <span class="broken-link">\yii\mongodb\file\file</span> attribute from file collection, using current primary key.</td>
        <td><a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a></td>
    </tr>
                <tr class="inherited" id="rules()">
        <td><a href="yii-base-model.html#rules()-detail">rules()</a></td>
        <td>Returns the validation rules for attributes.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="safeAttributes()">
        <td><a href="yii-base-model.html#safeAttributes()-detail">safeAttributes()</a></td>
        <td>Returns the attribute names that are safe to be massively assigned in the current scenario.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="save()">
        <td><a href="yii-db-activerecordinterface.html#save()-detail">save()</a></td>
        <td>Saves the current record.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="scenarios()">
        <td><a href="yii-base-model.html#scenarios()-detail">scenarios()</a></td>
        <td>Returns a list of scenarios and the corresponding active attributes.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="setAttribute()">
        <td><a href="yii-db-activerecordinterface.html#setAttribute()-detail">setAttribute()</a></td>
        <td>Sets the named attribute value.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="setAttributes()">
        <td><a href="yii-base-model.html#setAttributes()-detail">setAttributes()</a></td>
        <td>Sets the attribute values in a massive way.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="setIsNewRecord()">
        <td><a href="yii-db-baseactiverecord.html#setIsNewRecord()-detail">setIsNewRecord()</a></td>
        <td>Sets the value indicating whether the record is new.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="setOldAttribute()">
        <td><a href="yii-db-baseactiverecord.html#setOldAttribute()-detail">setOldAttribute()</a></td>
        <td>Sets the old value of the named attribute.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="setOldAttributes()">
        <td><a href="yii-db-baseactiverecord.html#setOldAttributes()-detail">setOldAttributes()</a></td>
        <td>Sets the old attribute values.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="setScenario()">
        <td><a href="yii-base-model.html#setScenario()-detail">setScenario()</a></td>
        <td>Sets the scenario for the model.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="toArray()">
        <td><a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a></td>
        <td>Converts the model into an array.</td>
        <td><a href="yii-base-arrayabletrait.html">yii\base\ArrayableTrait</a></td>
    </tr>
            <tr class="inherited" id="trigger()">
        <td><a href="yii-base-component.html#trigger()-detail">trigger()</a></td>
        <td>Triggers an event.</td>
        <td><a href="yii-base-component.html">yii\base\Component</a></td>
    </tr>
            <tr class="inherited" id="unlink()">
        <td><a href="yii-db-activerecordinterface.html#unlink()-detail">unlink()</a></td>
        <td>Destroys the relationship between two records.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="unlinkAll()">
        <td><a href="yii-db-baseactiverecord.html#unlinkAll()-detail">unlinkAll()</a></td>
        <td>Destroys the relationship in current model.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="update()">
        <td><a href="yii-db-activerecordinterface.html#update()-detail">update()</a></td>
        <td>Saves the changes to this active record into the database.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="updateAll()">
        <td><a href="yii-db-activerecordinterface.html#updateAll()-detail">updateAll()</a></td>
        <td>Updates records using the provided attribute values and conditions.</td>
        <td><a href="yii-db-activerecordinterface.html">yii\db\ActiveRecordInterface</a></td>
    </tr>
            <tr class="inherited" id="updateAllCounters()">
        <td><a href="yii-db-baseactiverecord.html#updateAllCounters()-detail">updateAllCounters()</a></td>
        <td>Updates the whole table using the provided counter changes and conditions.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="updateAttributes()">
        <td><a href="yii-db-baseactiverecord.html#updateAttributes()-detail">updateAttributes()</a></td>
        <td>Updates the specified attributes.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
            <tr class="inherited" id="updateCounters()">
        <td><a href="yii-db-baseactiverecord.html#updateCounters()-detail">updateCounters()</a></td>
        <td>Updates one or several counter columns for the current AR object.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
                <tr class="inherited" id="validate()">
        <td><a href="yii-base-model.html#validate()-detail">validate()</a></td>
        <td>Performs the data validation.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr class="inherited" id="validateMultiple()">
        <td><a href="yii-base-model.html#validateMultiple()-detail">validateMultiple()</a></td>
        <td>Validates multiple models.</td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
            <tr id="writeFile()">
        <td><a href="yii-mongodb-file-activerecord.html#writeFile()-detail">writeFile()</a></td>
        <td>Writes the the internal file content into the given filename.</td>
        <td><a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a></td>
    </tr>
    </table>
</div>

<div class="summary doc-method">
<h2>Protected Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-method" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
                                                                                                                                        <tr class="inherited" id="deleteInternal()">
        <td><a href="yii-mongodb-activerecord.html#deleteInternal()-detail">deleteInternal()</a></td>
        <td></td>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
    </tr>
                                <tr id="extractFileName()">
        <td><a href="yii-mongodb-file-activerecord.html#extractFileName()-detail">extractFileName()</a></td>
        <td>Extracts filename from given raw file value.</td>
        <td><a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a></td>
    </tr>
                        <tr class="inherited" id="findByCondition()">
        <td><a href="yii-db-baseactiverecord.html#findByCondition()-detail">findByCondition()</a></td>
        <td>Finds ActiveRecord instance(s) by the given condition.</td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
                                                                                                                                                                <tr id="insertInternal()">
        <td><a href="yii-mongodb-file-activerecord.html#insertInternal()-detail">insertInternal()</a></td>
        <td></td>
        <td><a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a></td>
    </tr>
                                                                                                            <tr class="inherited" id="resolveFields()">
        <td><a href="yii-base-arrayabletrait.html#resolveFields()-detail">resolveFields()</a></td>
        <td>Determines which fields can be returned by <a href="yii-base-arrayabletrait.html#toArray()-detail">toArray()</a>.</td>
        <td><a href="yii-base-arrayabletrait.html">yii\base\ArrayableTrait</a></td>
    </tr>
                                                                                        <tr id="updateInternal()">
        <td><a href="yii-mongodb-file-activerecord.html#updateInternal()-detail">updateInternal()</a></td>
        <td></td>
        <td><a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a></td>
    </tr>
                </table>
</div>

<a id="events"></a>
<div class="summary doc-event">
    <h2>Events</h2>

    <p><a href="#" class="toggle">Hide inherited events</a></p>

    <table class="summary-table table table-striped table-bordered table-hover">
    <colgroup>
        <col class="col-event" />
        <col class="col-type" />
        <col class="col-description" />
        <col class="col-defined" />
    </colgroup>
    <tr>
        <th>Event</th><th>Type</th><th>Description</th><th>Defined By</th>
    </tr>
        <tr class="inherited" id="EVENT_AFTER_DELETE">
        <td><a href="yii-db-baseactiverecord.html#EVENT_AFTER_DELETE-detail">EVENT_AFTER_DELETE</a></td>
        <td><a href="yii-base-event.html">yii\base\Event</a></td>
        <td>
            An event that is triggered after a record is deleted.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_AFTER_FIND">
        <td><a href="yii-db-baseactiverecord.html#EVENT_AFTER_FIND-detail">EVENT_AFTER_FIND</a></td>
        <td><a href="yii-base-event.html">yii\base\Event</a></td>
        <td>
            An event that is triggered after the record is created and populated with query result.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_AFTER_INSERT">
        <td><a href="yii-db-baseactiverecord.html#EVENT_AFTER_INSERT-detail">EVENT_AFTER_INSERT</a></td>
        <td><a href="yii-db-aftersaveevent.html">yii\db\AfterSaveEvent</a></td>
        <td>
            An event that is triggered after a record is inserted.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_AFTER_REFRESH">
        <td><a href="yii-db-baseactiverecord.html#EVENT_AFTER_REFRESH-detail">EVENT_AFTER_REFRESH</a></td>
        <td><a href="yii-base-event.html">yii\base\Event</a></td>
        <td>
            An event that is triggered after a record is refreshed.                            (available since version 2.0.8)
                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_AFTER_UPDATE">
        <td><a href="yii-db-baseactiverecord.html#EVENT_AFTER_UPDATE-detail">EVENT_AFTER_UPDATE</a></td>
        <td><a href="yii-db-aftersaveevent.html">yii\db\AfterSaveEvent</a></td>
        <td>
            An event that is triggered after a record is updated.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_AFTER_VALIDATE">
        <td><a href="yii-base-model.html#EVENT_AFTER_VALIDATE-detail">EVENT_AFTER_VALIDATE</a></td>
        <td><a href="yii-base-event.html">yii\base\Event</a></td>
        <td>
            An event raised at the end of <a href="yii-base-model.html#validate()-detail">validate()</a>                    </td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
        <tr class="inherited" id="EVENT_BEFORE_DELETE">
        <td><a href="yii-db-baseactiverecord.html#EVENT_BEFORE_DELETE-detail">EVENT_BEFORE_DELETE</a></td>
        <td><a href="yii-base-modelevent.html">yii\base\ModelEvent</a></td>
        <td>
            An event that is triggered before deleting a record.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_BEFORE_INSERT">
        <td><a href="yii-db-baseactiverecord.html#EVENT_BEFORE_INSERT-detail">EVENT_BEFORE_INSERT</a></td>
        <td><a href="yii-base-modelevent.html">yii\base\ModelEvent</a></td>
        <td>
            An event that is triggered before inserting a record.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_BEFORE_UPDATE">
        <td><a href="yii-db-baseactiverecord.html#EVENT_BEFORE_UPDATE-detail">EVENT_BEFORE_UPDATE</a></td>
        <td><a href="yii-base-modelevent.html">yii\base\ModelEvent</a></td>
        <td>
            An event that is triggered before updating a record.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        <tr class="inherited" id="EVENT_BEFORE_VALIDATE">
        <td><a href="yii-base-model.html#EVENT_BEFORE_VALIDATE-detail">EVENT_BEFORE_VALIDATE</a></td>
        <td><a href="yii-base-modelevent.html">yii\base\ModelEvent</a></td>
        <td>
            An event raised at the beginning of <a href="yii-base-model.html#validate()-detail">validate()</a>.                    </td>
        <td><a href="yii-base-model.html">yii\base\Model</a></td>
    </tr>
        <tr class="inherited" id="EVENT_INIT">
        <td><a href="yii-db-baseactiverecord.html#EVENT_INIT-detail">EVENT_INIT</a></td>
        <td><a href="yii-base-event.html">yii\base\Event</a></td>
        <td>
            An event that is triggered when the record is initialized via <a href="yii-db-baseactiverecord.html#init()-detail">init()</a>.                    </td>
        <td><a href="yii-db-baseactiverecord.html">yii\db\BaseActiveRecord</a></td>
    </tr>
        </table>
</div>

<a id="constants"></a>
<div class="summary doc-const">
    <h2>Constants</h2>

    <p><a href="#" class="toggle">Hide inherited constants</a></p>

    <table class="summary-table table table-striped table-bordered table-hover">
    <colgroup>
        <col class="col-const" />
        <col class="col-value" />
        <col class="col-description" />
        <col class="col-defined" />
    </colgroup>
    <tr>
        <th>Constant</th><th>Value</th><th>Description</th><th>Defined By</th>
    </tr>
            <tr class="inherited" id="SCENARIO_DEFAULT">
          <td id="SCENARIO_DEFAULT-detail">SCENARIO_DEFAULT</td>
          <td>'default'</td>
          <td>The name of the default scenario.
</td>
          <td><a href="yii-base-model.html">yii\base\Model</a></td>
        </tr>
        </table>
</div>

<h2>Property Details</h2>

<div class="property-doc">

    <div class="detail-header h3" id="$fileContent-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-activerecord.html#$fileContent-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/ActiveRecord.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/ActiveRecord.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $fileContent        <span class="detail-header-tag small">
            public                         <em>read-only</em>                         property
                    </span>
    </div>

    <div class="doc-description">
        <p>File content.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.null">null</a>|<a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-mongodb-file-activerecord.html#getFileContent()-detail">getFileContent</a></strong> ( )</div>


    <div class="detail-header h3" id="$fileResource-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-activerecord.html#$fileResource-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/ActiveRecord.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/ActiveRecord.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $fileResource        <span class="detail-header-tag small">
            public                         <em>read-only</em>                         property
                    </span>
    </div>

    <div class="doc-description">
        <p>File stream resource.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.resource">resource</a></span> <strong><a href="yii-mongodb-file-activerecord.html#getFileResource()-detail">getFileResource</a></strong> ( )</div>

</div>
<h2>Method Details</h2>

<div class="method-doc">

    <div class="detail-header h3" id="attributes()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-activerecord.html#attributes()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/ActiveRecord.php#L85" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/ActiveRecord.php#L85" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        attributes()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the list of all attribute names of the model.</strong></p>

        <p>This method could be overridden by child classes to define available attributes.
Note: all attributes defined in base Active Record class should be always present
in returned array.
For example:</p>
<pre><code class="hljs php language-php"><span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">attributes</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-keyword">return</span> array_merge(
        <span class="hljs-keyword">parent</span>::attributes(),
        [<span class="hljs-string">'tags'</span>, <span class="hljs-string">'status'</span>]
    );
}
</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.array">array</a></span> <strong><a href="yii-mongodb-file-activerecord.html#attributes()-detail">attributes</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of attribute names.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="extractFileName()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-activerecord.html#extractFileName()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/ActiveRecord.php#L220" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/ActiveRecord.php#L220" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        extractFileName()
        <span class="detail-header-tag small">
            protected                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Extracts filename from given raw file value.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">protected</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-mongodb-file-activerecord.html#extractFileName()-detail">extractFileName</a></strong> ( <span style="color: #0000BB">$file</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$file</span></td>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>Raw file value.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>File name.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidparamexception.html">yii\base\InvalidParamException</a></td>
                  <td class="param-desc-col"><p>on invalid file value.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="find()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-activerecord.html#find()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/ActiveRecord.php#L52" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/ActiveRecord.php#L52" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        find()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Creates an <span class="broken-link">\yii\mongodb\file\ActiveQueryInterface</span> instance for query purpose.</strong></p>

        <p>The returned <span class="broken-link">\yii\mongodb\file\ActiveQueryInterface</span> instance can be further customized by calling
methods defined in <span class="broken-link">\yii\mongodb\file\ActiveQueryInterface</span> before <code>one()</code> or <code>all()</code> is called to return
populated ActiveRecord instances. For example,</p>
<pre><code class="hljs php language-php"><span class="hljs-comment">// find the customer whose ID is 1</span>
<span class="hljs-variable">$customer</span> = Customer::find()-&gt;where([<span class="hljs-string">'id'</span> =&gt; <span class="hljs-number">1</span>])-&gt;one();

<span class="hljs-comment">// find all active customers and order them by their age:</span>
<span class="hljs-variable">$customers</span> = Customer::find()
    -&gt;where([<span class="hljs-string">'status'</span> =&gt; <span class="hljs-number">1</span>])
    -&gt;orderBy(<span class="hljs-string">'age'</span>)
    -&gt;all();
</code></pre>
<p>This method is also called by <span class="broken-link">\yii\mongodb\file\BaseActiveRecord::hasOne()</span> and <span class="broken-link">\yii\mongodb\file\BaseActiveRecord::hasMany()</span> to
create a relational query.</p>
<p>You may override this method to return a customized query. For example,</p>
<pre><code class="hljs php language-php"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Customer</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">ActiveRecord</span>
</span>{
    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">find</span><span class="hljs-params">()</span>
    </span>{
        <span class="hljs-comment">// use CustomerQuery instead of the default ActiveQuery</span>
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> CustomerQuery(get_called_class());
    }
}
</code></pre>
<p>The following code shows how to apply a default condition for all queries:</p>
<pre><code class="hljs php language-php"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Customer</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">ActiveRecord</span>
</span>{
    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">find</span><span class="hljs-params">()</span>
    </span>{
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">parent</span>::find()-&gt;where([<span class="hljs-string">'deleted'</span> =&gt; <span class="hljs-keyword">false</span>]);
    }
}

<span class="hljs-comment">// Use andWhere()/orWhere() to apply the default condition</span>
<span class="hljs-comment">// SELECT FROM customer WHERE `deleted`=:deleted AND age&gt;30</span>
<span class="hljs-variable">$customers</span> = Customer::find()-&gt;andWhere(<span class="hljs-string">'age&gt;30'</span>)-&gt;all();

<span class="hljs-comment">// Use where() to ignore the default condition</span>
<span class="hljs-comment">// SELECT FROM customer WHERE age&gt;30</span>
<span class="hljs-variable">$customers</span> = Customer::find()-&gt;where(<span class="hljs-string">'age&gt;30'</span>)-&gt;all();


</code></pre>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="yii-mongodb-file-activequery.html">yii\mongodb\file\ActiveQuery</a></span> <strong><a href="yii-mongodb-file-activerecord.html#find()-detail">find</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-mongodb-file-activequery.html">yii\mongodb\file\ActiveQuery</a></td>
                  <td class="param-desc-col"><p>The newly created <a href="yii-mongodb-file-activequery.html">yii\mongodb\file\ActiveQuery</a> instance.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getCollection()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-activerecord.html#getCollection()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/ActiveRecord.php#L61" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/ActiveRecord.php#L61" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getCollection()
        <span class="detail-header-tag small">
            public                        static            method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Return the Mongo GridFS collection instance for this AR class.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public static</span> <span class="signature-type"><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></span> <strong><a href="yii-mongodb-file-activerecord.html#getCollection()-detail">getCollection</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
                  <td class="param-desc-col"><p>Collection instance.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getFileContent()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-activerecord.html#getFileContent()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/ActiveRecord.php#L252" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/ActiveRecord.php#L252" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getFileContent()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the associated file content.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.null">null</a>|<a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-mongodb-file-activerecord.html#getFileContent()-detail">getFileContent</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.null">null</a>|<a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>File content.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidparamexception.html">yii\base\InvalidParamException</a></td>
                  <td class="param-desc-col"><p>on invalid file attribute value.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="getFileResource()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-activerecord.html#getFileResource()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/ActiveRecord.php#L316" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/ActiveRecord.php#L316" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getFileResource()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>This method returns a stream resource that can be used with all file functions in PHP,
which deal with reading files. The contents of the file are pulled out of MongoDB on the fly,
so that the whole file does not have to be loaded into memory first.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.resource">resource</a></span> <strong><a href="yii-mongodb-file-activerecord.html#getFileResource()-detail">getFileResource</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.resource">resource</a></td>
                  <td class="param-desc-col"><p>File stream resource.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidparamexception.html">yii\base\InvalidParamException</a></td>
                  <td class="param-desc-col"><p>on invalid file attribute value.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="insertInternal()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-activerecord.html#insertInternal()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/ActiveRecord.php#L102" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/ActiveRecord.php#L102" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        insertInternal()
        <span class="detail-header-tag small">
            protected                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong></strong></p>

        
        <p>See also <a href="yii-db-activerecordinterface.html#insert()-detail">yii\mongodb\file\ActiveRecord::insert()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">protected</span> <span class="signature-type">void</span> <strong><a href="yii-mongodb-file-activerecord.html#insertInternal()-detail">insertInternal</a></strong> ( <span style="color: #0000BB">$attributes&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attributes</span></td>
                  <td class="param-type-col"></td>
                  <td class="param-desc-col"></td>
                </tr>
                                                </table>

<!--	-->

    <div class="detail-header h3" id="refreshFile()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-activerecord.html#refreshFile()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/ActiveRecord.php#L239" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/ActiveRecord.php#L239" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        refreshFile()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Refreshes the <span class="broken-link">\yii\mongodb\file\file</span> attribute from file collection, using current primary key.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">\MongoGridFSFile|<a href="http://www.php.net/language.types.null">null</a></span> <strong><a href="yii-mongodb-file-activerecord.html#refreshFile()-detail">refreshFile</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">\MongoGridFSFile|<a href="http://www.php.net/language.types.null">null</a></td>
                  <td class="param-desc-col"><p>Refreshed file value.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="updateInternal()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-activerecord.html#updateInternal()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/ActiveRecord.php#L145" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/ActiveRecord.php#L145" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        updateInternal()
        <span class="detail-header-tag small">
            protected                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong></strong></p>

        
        <p>See also <a href="yii-db-activerecordinterface.html#update()-detail">yii\mongodb\file\ActiveRecord::update()</a>.</p>    </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">protected</span> <span class="signature-type">void</span> <strong><a href="yii-mongodb-file-activerecord.html#updateInternal()-detail">updateInternal</a></strong> ( <span style="color: #0000BB">$attributes&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$attributes</span></td>
                  <td class="param-type-col"></td>
                  <td class="param-desc-col"></td>
                </tr>
                                                    <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-db-staleobjectexception.html">yii\db\StaleObjectException</a></td>
                  <td class="param-desc-col"></td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="writeFile()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-activerecord.html#writeFile()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/ActiveRecord.php#L286" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/ActiveRecord.php#L286" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        writeFile()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Writes the the internal file content into the given filename.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-mongodb-file-activerecord.html#writeFile()-detail">writeFile</a></strong> ( <span style="color: #0000BB">$filename</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$filename</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Full filename to be written.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the operation was successful.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-base-invalidparamexception.html">yii\base\InvalidParamException</a></td>
                  <td class="param-desc-col"><p>on invalid file attribute value.</p>
</td>
                </tr>
                        </table>

<!--	-->
</div>
        </div>
</div>

<script type="text/javascript">
    /*<![CDATA[*/
    $("a.toggle").on('click', function () {
        var $this = $(this);
        if ($this.hasClass('properties-hidden')) {
            $this.text($this.text().replace(/Show/,'Hide'));
            $this.parents(".summary").find(".inherited").show();
            $this.removeClass('properties-hidden');
        } else {
            $this.text($this.text().replace(/Hide/,'Show'));
            $this.parents(".summary").find(".inherited").hide();
            $this.addClass('properties-hidden');
        }

        return false;
    });
    /*
     $(".sourceCode a.show").toggle(function () {
     $(this).text($(this).text().replace(/show/,'hide'));
     $(this).parents(".sourceCode").find("div.code").show();
     },function () {
     $(this).text($(this).text().replace(/hide/,'show'));
     $(this).parents(".sourceCode").find("div.code").hide();
     });
     $("a.sourceLink").click(function () {
     $(this).attr('target','_blank');
     });
     */
    /*]]>*/
</script>


</div>

<footer class="footer">
        <p class="pull-right"><small>Page generated on Sat, 09 Jul 2016 12:15:57 +0000</small></p>
    Powered by <a href="http://www.yiiframework.com/" rel="external">Yii Framework</a></footer>

<script type="text/javascript">jQuery(document).ready(function () {
    var shiftWindow = function () { scrollBy(0, -50) };
    if (location.hash) setTimeout(shiftWindow, 1);
    window.addEventListener("hashchange", shiftWindow);
var element = document.createElement("script");
element.src = "./jssearch.index.js";
document.body.appendChild(element);

var searchBox = $('#searchbox');

// search when typing in search field
searchBox.on("keyup", function(event) {
    var query = $(this).val();

    if (query == '' || event.which == 27) {
        $('#search-resultbox').hide();
        return;
    } else if (event.which == 13) {
        var selectedLink = $('#search-resultbox a.selected');
        if (selectedLink.length != 0) {
            document.location = selectedLink.attr('href');
            return;
        }
    } else if (event.which == 38 || event.which == 40) {
        $('#search-resultbox').show();

        var selected = $('#search-resultbox a.selected');
        if (selected.length == 0) {
            $('#search-results').find('a').first().addClass('selected');
        } else {
            var next;
            if (event.which == 40) {
                next = selected.parent().next().find('a').first();
            } else {
                next = selected.parent().prev().find('a').first();
            }
            if (next.length != 0) {
                var resultbox = $('#search-results');
                var position = next.position();

//              TODO scrolling is buggy and jumps around
//                resultbox.scrollTop(Math.floor(position.top));
//                console.log(position.top);

                selected.removeClass('selected');
                next.addClass('selected');
            }
        }

        return;
    }
    $('#search-resultbox').show();
    $('#search-results').html('<li><span class="no-results">No results</span></li>');

    var result = jssearch.search(query);

    if (result.length > 0) {
        var i = 0;
        var resHtml = '';

        for (var key in result) {
            if (i++ > 20) {
                break;
            }
            resHtml = resHtml +
            '<li><a href="' + result[key].file.u.substr(3) +'"><span class="title">' + result[key].file.t + '</span>' +
            '<span class="description">' + result[key].file.d + '</span></a></li>';
        }
        $('#search-results').html(resHtml);
    }
});

// hide the search results on ESC
$(document).on("keyup", function(event) { if (event.which == 27) { $('#search-resultbox').hide(); } });
// hide search results on click to document
$(document).bind('click', function (e) { $('#search-resultbox').hide(); });
// except the following:
searchBox.bind('click', function(e) { e.stopPropagation(); });
$('#search-resultbox').bind('click', function(e) { e.stopPropagation(); });

});</script></body>
</html>
